﻿@model EvincePayroll.Data.PageTemplateData
@{
    Layout = "~/Views/Shared/_Layout_Admin.cshtml";
    ViewBag.Title = "ListPage";
}

<link href="../../Content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
@*<link href="../../Content/table/jquery.alerts.css" rel="stylesheet" type="text/css" />*@
<script src="../../js/table/jquery.dataTables.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
//        $('#formAddNewRow').hide();
var oTable2 = $('#leaveRequestsTable').dataTable({

            "bServerSide": true,
            "sAjaxSource": "/PageTemplate/AjaxGetListPage",
            "bProcessing": true,
            "sPaginationType": "full_numbers",
            "aoColumns":
[
{ "sName": "PageId", "sTitle": "Page ID", "bVisible": false, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[0]; } },
{ "sName": "PageCode", "sTitle": "PageCode", "sWidth": 100, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[1]; } },
{ "sName": "DisplayTitle", "sTitle": "Display Title", "sWidth": 120, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[2]; } },
{ "sName": "MetaKeywords", "sTitle": "Meta Keywords", "sWidth": 250, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[3]; } },
{ "sName": "MetaDescription", "sTitle": "MetaDescription", "sWidth": 250, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[4]; } },
{ "sName": "Status", "sTitle": "Status", "sWidth": 70, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[5]; } },
{ "sName": "", "sTitle": "", "sWidth": 70, "bVisible": true, "bSortable": true, "fnRender": function (oObj) { return oObj.aData[6]; } },


]
        });
        oTable2 = $('#leaveRequestsTable').dataTable();





    });
    function DeleteCMS(pageId) {

        var temp = confirm('Are you sure want to delete?');
        if (temp == true) {
            $.ajax({
                type: "POST",
                url: "/PageTemplate/DeleteCMS?pageId=" + pageId,
                success: function (result) {
                    var oTable2 = $('#leaveRequestsTable').dataTable();
                    oTable2.fnDraw();
                    $('#leaveRequestsTable').width('auto');
                    return false;
                }
            });
        }
    }

    

</script>

<div class="grid_10" >
            <div class="box round first grid">
            <div id="demo">
                <h2>List CMS</h2>
                <div class="block">
                      
   @* <button id="btnDeleteRow" value="cancel" class="btn btn-orange">Delete Leave Record</button>*@
                    <table class="data display datatable" id="leaveRequestsTable">
					<thead>
                <tr>
                 
                     <th>
                    </th>
                    <th>
                    </th>
                    <th>
                    </th> 
                    <th>
                    </th>                    
                    <th>
                        
                    </th>
                     <th>
                        
                    </th>
                    <th>
                    </th>
                    
                </tr>
            </thead>
					
				</table>
                    

               
                 


    </div>
</div>
</div>

</div>
